package com.company;

import java.util.Scanner;

/**
 * @description:
 * @author: Lenovo
 * @date: Crcoted in 2020/05/25 20:58
 * @version:${VERSION}
 * @modified By:
 */
public class Ui {


        public static void printWelcome (Person person) {
            System.out.println();
            System.out.println("欢迎来到魔兽房间！");
            System.out.println("这是一个好玩的游戏。");
            System.out.println("如果需要帮助，请输入 'help' 。");
            System.out.println();

            displayReachableRooms(person);
        }
    public static void displayReachableRooms (Person person) {
        System.out.println("如果你输入打怪，就可以进入打怪模式");
        System.out.println("在有生命药水的房间输入拿取生命药水，就可以获得hp");
        System.out.println("如果你输入返回，就可以退出打怪模式");
        System.out.println("现在你在" + person.getCurrentRoom().getId() +"("+ person.getCurrentRoom().toString()+")");
        System.out.print("出口有：");
        for (String key : person.getCurrentRoom().getReachableRooms().keySet()
        ) {
            System.out.print(key + "(" + person.getCurrentRoom().getReachableRooms().get(key).getDescription() + ")" + " ");
        }
        System.out.println();
    }

    public  void displayStaus(Sense sense) {


        System.out.println();
        System.out.println("------------------------------------");
        System.out.println(sense.getPerson().getDescription()+":"+sense.getPerson().getHp());
        for (Monsters item:sense.getMonstersSet().getBadMonster()
        ) {
            System.out.print(item.getId()+"("+item.getDescription()+"):"+item.getHp()+";");
        }
        System.out.println();
        System.out.println("------------------------------------");
        System.out.println();
    }



    public void displayHelpMsg(){
        System.out.println("有三条命令可选：1.chop 2.bye 3.help ");
    }
    public void displayBye(){
        System.out.println("游戏结束，再见");
    }
    public void displayErrorCmdMsg(){
        System.out.println("你输入的是错误命令");
    }
    public void displayDamageMsg(Creature attackct,Creature badct){
        System.out.print(attackct.getDescription()+"对"+badct.getDescription()+"造成"+attackct.getCurrentWeapon().getDamadePoints()+"伤害。");

    }

    //显示当前房间出口所有方向
    public static void printNoRoom () {
        System.out.println("那里没有房间！");
    }

    public static void printErrorCommand () {
        System.out.println("输入错误命令，重新输入。");
    }
    public static void printHelp () {
        System.out.print("迷路了吗？你可以做的命令有：go bye help");
        System.out .println("如：\tgo 1");
    }
}


